﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using Csla;
using Csla.Data;

namespace BO
{
     [Serializable()]
    public partial class DepartmentList : BusinessListBaseEx<DepartmentList,Department>,IBusinessList
    {
        #region Business Properties and Methods

        public Department GetByOID(Int32 ID )
        {
            foreach (var r in this)
            {
                if (
            Object.Equals(ID , r.ID)&&
           true
                )
                {
                    return r;
                } 
            }    
            return null;
        }



        public void RemoveByOID(Int32 ID )
        {
            Remove(GetByOID(ID ));
        }


        #endregion

        #region Contains

        public bool ContainsDeleted(Int32 ID )
        {
            foreach (var r in DeletedList)
            {
                if (
            Object.Equals(ID , r.ID)&&
           true
                )
                {
                    return true;
                }    
            }    
            return false;
        }

        public bool Contains(Department pDepartment)
        {
            foreach (var r in this)
                if (Object.Equals(pDepartment,r))
                    return true;
            return false;
        }


        #endregion


        #region Custom Methods
        #endregion
        public static string GetListName()
        {return "DepartmentList";}
    }
    
    
}